-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor PropertyValue to TS #4686
Conversation
Testing this now - my first comment on this is the same as @timgl had on my first "fix", how do I know what to type on the paths input? I should be getting suggestions right away. Is that what you meant by autofocus? It's indeed annoying because |
Another issue is something I was also looking to fix (I think it may have always been broken) - is that changing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll review the code once the behavioral issues above are addressed. Like I said on our call, there's a lot of problems here beyond just types.
I got beat up by this component yesterday 😂
Another issue here (also related to legacy bad practices), is that the query for events expects an integer, so it's failing now as we're sending it a string. Previously, we would show autocomplete options as strings but then assign their id as the value, so the user would see a random This is another issue I was facing |
Argh, thought I submitted the updated description. Yes, that's what I meant by autocomplete -- will work on today. |
Why do we separate Path Type and Start Point? Seems weird to make the user explicitly decide between autocaptured and custom events, for example, when those types are not differentiated elsewhere. I know this might seem like a UX nitpick, but the weird state mismatches that occur when switching from one path type to another might be solved, for instance, by using SelectBox like we do elsewhere. EDIT: See images and more context here: #4703. |
9927051
to
223b5fd
Compare
@EDsCODE @paolodamico I see you both did some work on PropertyValue some time ago... if you have any time to take a look, could you see if I'm missing something regarding getting the dropdown to open as soon as results are loaded? Have been stuck on this for a while. |
I gave it a go and ~90min later I think I have something that works. I think the problem with the dropdown not opening was this: <AutoComplete>
{input ? <Option ... /> : null}
{options.map(o => <Option ... />)}
</AutoComplete> The first element was There was also a problem with the "custom element" view, where the text Plus various type fixes and other small tweaks to make sure things work. The only thing that's still broken is this: If you search for a custom element, we put the ID in the URL. If you then reload the page, you'll only see the ID in the dropdown, as we haven't downloaded the list of elements and can't really match this ID to any better string. Since the custom element paths page itself is quite useless, I propose to leave it at that for now and move on. :) |
Also managed to find and fix a sql injection (cc @EDsCODE) @samwinslow @paolodamico @yakkomajuri do you think this is safe to merge now? Obviously cypress is borked and we don't know if anything is broken or not 😅 |
I actually have little context on this, so I'll defer to @samwinslow, though do let me know if you want me to take a closer look. |
@mariusandra there's still the problem of switching path types with the input persisting but the graph changing. So it says |
That should also be fixed now. Hopefully without breaking anything else :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behavior-wise :thisisfine: - will leave the code review of @mariusandra's changes to @samwinslow
Re-running all tests locally to see what failures, if any, should be addressed. |
Changes
Goal: Make state management in PropertyValue more clear; make debugging easier via static typing. It should now be evident that PropertyValue handles string values and array values quite differently from each other.
Closes #4665.
UPDATE:
As I want to get this done in a timely manner and not spend any extra time building a controlled dropdown state,
for now I updated the copy on user paths to suggest the user has to start typing in order for results to show. (WIPSelect
-->Search
).A better fix would be somewhat simple; all we need to do is trigger the dropdown to open after results are loaded (requiring controlled state). I just want to get this done for now, though.
Checklist